package com.ming.feign;

import com.ming.domain.Basket;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author:何元才
 * @Desc:
 * @data:2021-04-09 19:42
 */
@FeignClient(value = "cart-service")
public interface OrderCartFeign {

    /**
     * 远程调用购物车 根据ids拿到集合
     *
     * @param basketIds
     * @return
     */
    @PostMapping("p/shopCart/getCartsByIds")
    List<Basket> getCartsByIds(@RequestBody List<Long> basketIds);

    /**
     * 远程调用清空购物车的方法
     *
     * @param userId
     * @param skuIds
     */
    @PostMapping("p/shopCart/clearCart")
    void clearCart(@RequestParam String userId, @RequestBody List<Long> skuIds);



}
